﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;

namespace ERPService
{
    // 注意: 您可以使用 [重構] 功能表上的 [重新命名] 命令同時變更程式碼和組態檔中的介面名稱 "IService1"。
    [ServiceContract]
    public interface IService
    {
        [OperationContract]
        Command Login(string Name, string Password, string MAC);

        [OperationContract]
        Command GetLastOrder(string Name, int Token);

        [OperationContract]
        ReferenceClass noneUse();
    }

    /// <summary>
    /// 傳輸命令格式
    /// </summary>
    [DataContract]
    [Serializable]
    public class Command
    {
        //帳號權限相關錯誤資訊
        [DataMember]
        public int Error { get; set; }

        //服務相關錯誤資訊
        [DataMember]
        public int Detail { get; set; }

        [DataMember]
        public int Token { get; set; }

        [DataMember]
        public string Content { get; set; }
        public Command()
        {
            Error = 0;
            Token = 0;
            Detail = 0;
            Content = null;
        }
    }

    [DataContract]
    public class ReferenceClass
    {
        [DataMember]
        public OrderList orders { get; set; }
        public ReferenceClass()
        {
            orders = null;
        }
    }
}
